import request from '../utils/request';
import logRequest from '../utils/requestNoToken';

// 登录
export const login = (query) => {
    return logRequest.post('/zsrencai/api/sys/admin/user/login', query);
};
// 退出登录

// 校验图片
export const captchaImg = (query) => {
    return logRequest.get('/zsrencai/api/sys/admin/captcha/validate', { params: query });
};
// 发送短信
export const postMsg = (query) => {
    return logRequest.post('/zsrencai/api/sys/admin/sms/code', query);
};
// 字典 /zsrencai/api/sys/admin/tc/find/{code}
export const findDictByCode = (code) => {
    return request.get('/zsrencai/api/sys/admin/dict/find/' + code);
};
//获取学历字典
export const education = () => {
    return request.get('/zsrencai/api/sys/admin/dict/find/education');
};
// 单位性质
export const getNature = () => {
    return request.get('/zsrencai/api/sys/admin/dict/find/company_nature');
};
// 产业
export const getIndustry = () => {
    return request.get('/zsrencai/api/sys/admin/dict/find/industry');
};
// 位置
export const getArea = () => {
    return request.get('/zsrencai/api/sys/admin/dict/find/area');
};
// 规模
export const getScale = () => {
    return request.get('/zsrencai/api/sys/admin/dict/find/scale');
};
// 美元
export const getAmountUnit = () => {
    return request.get('/zsrencai/api/sys/admin/dict/find/amount_unit');
};
// 福利标签
export const getAllure = () => {
    return request.get('/zsrencai/api/sys/admin/dict/find/allure');
};
// 行业
export const findTradeDict = () => {
    return request.get('/zsrencai/api/sys/admin/tc/find/tree');
};
// 上传图片
export const postPicture = (query) => {
    return request.post('/zsrencai/api/sys/admin/file/image/upload', query, { headers: { 'Content-Type': 'multipart/form-data' } });
};
// 当前用户菜单列表
export const getMenu = () => {
    return request.get('/zsrencai/api/sys/admin/menu/list/current');
};
// 验证token
export const token = () => {
    return request.post('/zsrencai/api/sys/admin/enterprisedata/selectindustrys');
};
// 验证失业人员
export const loseMenu = () => {
    return request.post('/zsrencai/api/sys/admin/user/lose/menu');
};
// 首页待办事项
export const examineCount = (query) => {
    return request.post('/zsrencai/api/sys/admin/index/get/not/examine/count', query, {
        headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
    });
};
// 管理后台修改密码接口:http://localhost:8100/zsrencai/api/sys/admin/admin-user/edit/user/password
// post请求
// 参数:oripassword原密码
//        newpassword新密码
//       repassword确认密码
export const resetPassword = (query) => {
    return request.post('/zsrencai/api/sys/admin/admin-user/edit/user/password', query);
};

//获取二维码
export const getUserlogin = (time) => {
    return request.get(`/zsrencai/api/sys/admin/user/get/qrcode/${time}`);
};

//查看登录状态
export const wxLogin = (time) => {
    return request.post(`/zsrencai/api/sys/admin/user/wx/login`, time);
};
